<?php

class ArticleManagerException extends Exception {

    const GENERIC_ERROR = 0;
    const ARTICLE_NOT_EXISTS_ERROR = 1;
    const PASSED_ARGUMENT_IS_NOT_ARTICLE_ERROR = 2;
    const ARTICLES_ID_NOT_MATCH_ERROR = 3;
    const GENERIC_TAG_ERROR = 4;
    const GENERIC_CATEGORY_ERROR = 5;
    const GENERIC_STUFF_ERROR = 6;

    public function __construct($message = '', $code = self::GENERIC_ERROR) {
        parent::__construct($message, $code);
    }

    public function __toString() {
        return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
    }

}

?>